Issue 52657: LKSM: We shouldn't allow creating sample names that differ only in case.#6820
Merged
Issue 52657: LKSM: We shouldn't allow creating sample names that differ only in case.#6820
Conversation
labkey-susanh
approved these changes
Jul 9, 2025
| if (!container.getId().equals(dataContainer)) | ||
| throw new InvalidKeyException("Data doesn't belong to folder '" + container.getName() + "': " + key.getValue().values()); | ||
| } | ||
| // sql server will return case-insensitive match |
Contributor
There was a problem hiding this comment.
I'm not sure how this comment relates to the lines below since there's nothing that says case-sensitive or -insensitive to me.
Contributor
Author
There was a problem hiding this comment.
Updated comment to explain why we need to do a java equals check after sql =
| return hasNext; | ||
|
|
||
| Map<String, Object> existingValues = getExistingRecord(); | ||
| if (existingValues != null && !existingValues.isEmpty() && existingValues.get(NAME_FIELD).equals(newName)) |
Contributor
There was a problem hiding this comment.
Should this be equalsIgnoreCase?
Contributor
Author
There was a problem hiding this comment.
No, if the case is different, we need to check if renaming is allowed for update and merge. For merge, the work put in is just theoretically at the moment. We don't allow support merge operations that updates names.
| .append(tableInfo) | ||
| .append(" WHERE LOWER(name) = LOWER(?)") | ||
| .add(newOrExistingName); | ||
| if (allowExisting) // // exclude existing name for merge |
Contributor
There was a problem hiding this comment.
Aren't we allowing existing names for merge?
This was referenced Jul 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
There has been inconsistency when it comes allowing case sensitive duplicate sample/data names. With this PR, duplicate names that varies only in cases should no longer be allowed.
Related Pull Requests
Changes
QUS._update